package com.dangf.controller;

import java.util.HashMap;
import java.util.Map;

/**
 * 基础控制器
 * @author hais1992
 *
 */
public class BaseController {
	protected static Map<String, Object> result = new HashMap<String, Object>();	//用于返回json的结果
	protected static final String HTTP_CODE = "code";
	protected static final String HTTP_MSG = "msg";
	protected static final String HTTP_DATA = "data";
	
	protected static final String HTTP_CODE_SUCCESS = "200";		//成功
	protected static final String HTTP_CODE_FAILED = "400";		//失败
	protected static final String HTTP_CODE_ACCES_ERROR = "401";			//权限
	protected static final String HTTP_CODE_URL_ERROR = "403";			//不存在
	protected static final String HTTP_CODE_SERVER_ERROR = "500";			//无效
	
	
	
	protected Map<String,Object> setResult(String code,String msg,Object data) {
		result.put(HTTP_CODE, code);
		result.put(HTTP_MSG, msg);
		result.put(HTTP_DATA, data);
		return result;
	}

}
